import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
 import Home from "../views/HomePage.vue";
import Tutorial from "../views/TutorialPage.vue";
import NotFound from "../views/NotFound.vue";
import About from "../views/About.vue";
import Contact from "../views/Contact.vue";


const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/contact",
    name: "contact",
    component: Contact,
  },
  {
    path: "/tutorial",
    name: "Tutorial",
    component: Tutorial,
  },
  {
    path: "/about",
    name: "About",
    component: About,
  },
   // 配置通配符路由，匹配所有未匹配到的路由
   {
    path: "/:catchAll(.*)",
    name: "NotFound",
    component: NotFound, // 404 页面组件
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
